package com.raycloud.erp.omll.provider.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 枫伦
 * @description: 退款状态
 * @date 2020/11/18 9:22 上午
 */
public class OmallRefundStatus {

    /**
     * 待审核
     */
    public static final String REFUND_STATUS_WAIT = "wait";
    /**
     * 审核通过
     */
    public static final String REFUND_STATUS_PASSED = "passed";
    /**
     * 审核不通过
     */
    public static final String REFUND_STATUS_NOT_PASSED = "notpassed";
    /**
     * 平台驳回
     */
    public static final String REFUND_STATUS_REJECT = "reject";
    /**
     * 供应商驳回
     */
    public static final String REFUND_STATUS_SREJECT = "sreject";


    public static Map<String, String> refundStatusMap = new HashMap<String, String>();


    static {
        //待卖家同意
        refundStatusMap.put(getRefundStatusMapKey(REFUND_STATUS_WAIT), ErpStatusConstant.RefundStatus.REFUND_WAIT_SELLER_AGREE);
        /**
         * 待卖家确认收货
         */
        refundStatusMap.put(getRefundStatusMapKey(REFUND_STATUS_PASSED), ErpStatusConstant.RefundStatus.REFUND_SUCCESS);
        /**
         * 卖家拒绝退款
         */
        refundStatusMap.put(getRefundStatusMapKey(REFUND_STATUS_NOT_PASSED), ErpStatusConstant.RefundStatus.REFUND_SELLER_REFUSE_BUYER);
        /**
         * 卖家拒绝退款
         */
        refundStatusMap.put(getRefundStatusMapKey(REFUND_STATUS_REJECT), ErpStatusConstant.RefundStatus.REFUND_SELLER_REFUSE_BUYER);
        /**
         * 卖家拒绝退款
         */
        refundStatusMap.put(getRefundStatusMapKey(REFUND_STATUS_SREJECT), ErpStatusConstant.RefundStatus.REFUND_SELLER_REFUSE_BUYER);
    }

    private static String getRefundStatusMapKey(String returnStatus) {
        String status = Constants.SOURCE + "_" + returnStatus;
        return status;
    }

    public static String getRefundStatus(String returnStatus) {
        return refundStatusMap.get(getRefundStatusMapKey(returnStatus));
    }

    public String getSource() {
        return Constants.SOURCE;
    }
}
